﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZL.CRM.CommonEntity.Common;
using ZLWeb.WebApiEntityBase;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;

namespace ZL.CRM.CommonEntity.AccQuery
{
    public class WalletDetail:WalletAdd
    {

        /// <summary>
        ///  钱包类型：1-红包 2-退消费
        /// </summary>
        public short Oprwtype { get; set; }

        /// <summary>
        ///  钱包类型说明（充值、红包、退消费、过期红包）（若红包过期，则显示过期红包（仅接口运行时提供））
        /// </summary>
        public string Oprwtypesm { get; set; }

        /// <summary>
        ///  钱包总额：现金金额
        /// </summary>
        public decimal Oprincashmy { get; set; }

        /// <summary>
        ///  钱包总额：增值金额
        /// </summary>
        public decimal Oprinaddmy { get; set; }

        /// <summary>
        ///  钱包是否已用完：1-已用完
        /// </summary>
        public short Oprwisover { get; set; }

        /// <summary>
        ///  本次使用：现金钱包
        /// </summary>
        public decimal Oprxfxj { get; set; }

        /// <summary>
        ///  本次使用：增值钱包
        /// </summary>
        public decimal Oprxfzz { get; set; }

        /// <summary>
        ///  钱包余额：现金金额
        /// </summary>
        public decimal Opraftxj { get; set; }

        /// <summary>
        ///  钱包余额：增值金额
        /// </summary>
        public decimal Opraftzz { get; set; }

        /// <summary>
        ///  红包增值钱包开始使用日期
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime Oprhbbegdate { get; set; }

        /// <summary>
        ///  红包增值钱包截止使用日期
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime Oprhbenddate { get; set; }

        /// <summary>
        ///  钱包核算营业日
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime Oprskyydate { get; set; }

        public long RemoveHbAccid { get; set; }

        public string RemoveHbOprsno { get; set; }
    }
    public class WalletDetailMapper : ClassMapper<WalletDetail>
    {
        public WalletDetailMapper()
        {
            Table("#WalletDetail");
            Map(f => f.Oprwno).Column("Oprwno");
            Map(f => f.Oprwtype).Column("Oprwtype");
            Map(f => f.Oprwtypesm).Column("Oprwtypesm");
            Map(f => f.Oprincashmy).Column("Oprincashmy");
            Map(f => f.Oprinaddmy).Column("Oprinaddmy");
            Map(f => f.Oprwisover).Column("Oprwisover");
            Map(f => f.Oprxfxj).Column("Oprxfxj");
            Map(f => f.Oprxfzz).Column("Oprxfzz");
            Map(f => f.Opraftxj).Column("Opraftxj");
            Map(f => f.Opraftzz).Column("Opraftzz");
            Map(f => f.Oprhbbegdate).Column("Oprhbbegdate");
            Map(f => f.Oprhbenddate).Column("Oprhbenddate");
            Map(f => f.Oprskyydate).Column("Oprskyydate");
            Map(f => f.Oprskbrid).Column("Oprskbrid");
            Map(f => f.Oprskbrname).Column("Oprskbrname");
            Map(f => f.Oprskppid).Column("Oprskppid");
            Map(f => f.Oprskppname).Column("Oprskppname");
            Map(f => f.RemoveHbAccid).Column("RemoveHbAccid");
            Map(f => f.RemoveHbOprsno).Column("RemoveHbOprsno");
        }

    }
}
